Editing MAT Files and their parameters.
Using MAT & TGA Files with the IL2-MAT program.
Creating TGA Files and Example Movies.
Resizing and Positioning Regiment/Unit Emblems.
What is a MAT file?.
Put simply a MAT file is a text file with a "MAT" file extension that displays a specific graphic file (TGA format with Alpha information) at a specific point on the plane. I have de-cyphered the MAT filenaming convention for all of the Luftwaffe single engined fighter types as follows.
MAT filename convention.
All Luftwaffe sinngle engined planes such as the P11.c, Bf109 series and FW190 series have the following filenaming convention:
Plane Numbers (and substitute
Letters).
Here is a typical MAT filename: psFM03GERRNUM1205.MAT. This filename breaks down as follows.
ps = ?
F = Fighter (B = Bomber eg. Ju87)
M = Marking ?
00-05 = Plane Type (00 = P11.c, 01 = Bf109e4 & ALL Fw190 models, 02 = Bf109e7/z, 03 = Bf109F2,F4 & G2, 04 = Bf109G6 models, 05 = Bf109G-10, Bf109G-14, Bf109K4, Fw190D models added in Forgotten Battles).
Note: The Fw190F-8 fighter bomber model added in Forgotten Battles has a code of BM03 whilst the other plane models listed above have a FM prefix.
GER = German Nationality (RUS = Russian, SLVK = Slovakian etc.)
L/R or C = Left side of plane, Right side of plane or Combined number) There are allways a set of TWO MAT files L and R or one "C" MAT file per plane number. L/R MAT files do not mirror so one TGA graphics file per plane number le is all that is required.
NUM = A Plane Numbering MAT file..
1 = Gruppe/Regiment number (0 = Gruppe 1, 1 = Gruppe 2, 2 = Gruppe 3, 3 = Gruppe 4)
2 = Staffel/Squadron Number (0 = Staffel 1, 1 = Staffel 2, 2 = Staffel 3, 3 = Staffel 4)
05 = Plane Number
So the above example refers to MAT file which loads a Fighter aircraft type Bf109G6, German, Right hand side plane number graphic, to be displayed on a 2nd Gruppe, 3rd Staffel aircraft number 5. With my substitute MAT files this would display a "Yellow 5" TGA file.
Exception.
The MAT filenames of the P11.c (psFM00..), Bf109e4/Fw190 (psFM01....) and Bf109E7/Z (psFM02...) for numbers 1-9 only use a 3 digit code at the end of the filename eg. psFM01GERRNUM007.MAT (Gruppe, Staffel, Plane Number) rather than the four digit numbers which appear on PsFM03 and PsFM04 MAT files.
Plane Letters.
I have substituted letters A-T for the numbers 1-20 for bf109e4/Fw190 aircraft and bf109e7/7z aircraft in the 4th Gruppe to replicate the lettering used by "Schlacht" or ground attack Gruppen. These letter-number substitutions can be used by selecting a 4th Gruppe (Regiment) in the arming screen, selecting one of these aircraft types and then select the aircraft number according to the required letter eg. 1=A 2=B etc. I have created four sets of the letters, White, Black, Yellow and Blue for different staffels within the Gruppe. These are available for download either as an add-on pack or they are included in my all_MAT_and_TGA_Files_New download.
Gruppe Symbols.
The MAT filenames of Gruppe symbols use the following convention:
psFM00GER etc. as explained above and then
GRUPP = A Gruppe symbol MAT file.
4 = Gruppe Number (2-4 : Gruppes 2-4) Note there isn't one for Gruppe 1 (GRUPP1). as 1st Gruppe fighter aircraft didn't display a Gruppe symbol and as no MAT exists there's currently no way of putting anything in this position.
S = Staffel
2 = Staffel Number (1 = Staffel 1, 2 = Staffel 2, 3 = Staffel 3, 0 = Staffel 4) Note Staffel 4 is Zero not Four.
So this MAT filename psFM04GERGRUPP4S3 displays the gruppe symbol for a BF109G6 aircraft 4th Gruppe, 3rd Staffel eg. with my substitute weathered coloured gruppe symbols this would display a yellow "+" symbol graphic.
Commander's Gruppe Symbols.
These MAT filenames are for special black with white border versions of the Gruppe symbols displayed on the commander's plane eg. the first plane in the first Staffel of a Gruppe and use the following convention:
psFM00GER etc. as explained above and then
COM = A MAT file for a Commander's aircraft.
C = Combined graphic eg. one version of graphic for both sides of the aircraft.
GID = A Commander's Gruppe ID MAT File.
4 = Gruppe Number (2-4 = Gruppes 2 -4) Note there isn't one for Gruppe 1 (GID1). Sadly this means that it isn't currently possible to have Geshwader Stab aircraft markings such as the Geswader Kommodor <-+- type marking correctly displayed as there isn't a MAT file to display the last last "-" symbol. If I can find a way to get round this I'll let you know.
So this MAT filename psFM01GERCOMCGID4 displays the commander's gruppe symbol for a BF109e4/Fw190 aircraft of the 4th Gruppe, eg. a black ~ with white border. Note in some of my files which display tactical markings I have edited the MAT file by deleting the last line so no graphic is displayed as I believe this was historically the case with these markings.
Commander Tactical
Marking Symbols..
These MAT filenames are for special black and white coloured commander's tactical marking symbols, the chevrons which are displayed on the commander's plane eg. the first plane in the first Staffel of a Gruppe and use the following convention:
psFM00GER etc. as previously explained and
COM = A MAT file for a Commander's aircraft..
L/R = Left side of plane, Right side of plane. There are allways a set of TWO MAT files L and R. They MIRROR so TWO mirrored TGA graphic files are required. ie. one TGA file let's say the chevron < which goes on the left side of the plane is mirrored thus > in the other TGA file which goes on the right side of the plane. Simply use the flip horizontally or mirror function in your graphics software to produce the mirrored version of the TGA file.
0000 = These MAT files allways end with four zeros as Gruppe/Staffel/Plane Number information isn't applicable.
So this MAT filename psFM01GERCOML0000 displays the commander's chevron symbol graphic for a BF109e4/Fw190 left hand side of the aircraft.
My Tactical Markings add-on pack and my updated All_MAT_and TGA_Files_New download both include 19 different Geshwader and Gruppe tactical markings for use on all models of Luftwaffe single-engined fighter aircraft. Whilst it isn't possible to have more than one type displayed at the same time on the same aircraft model it is possible to have different tactical markings displayed on different models of aircraft at the same time. My download ZIP files make several sub-folders within the "CoopRegt" folder, one for each tactical marking, each of which in-turn contain folders for each aircraft type grouping eg. psFM01, psFM02 etc. containing the MAT files to display this tactical marking on this aircraft type. Copy these files to your main "CoopRegt" folder before launching the IL2 program whenever you wish to change to a different tactical marking. I hope at some stage that Andrew the creator of IL2MAT will be able to incorporate this option within the program's configuration settings in the same way as you can currently do with substitute Regimental/Gruppe emblems. Please see later in this tutorial for details of unziping my TGA and MAT files and configuring the IL2MAT program to correctly display them.
Editing MAT Files and their parameters.
MAT files can be edited in a normal text editor such as Notepad supplied with Windows. Rememeber to keep the MAT filename extension and do not let Notepad add a "TXT" extension or manually rename the file extension back to MAT. Here is a MAT file displayed in notepad.

The first yellow area highlited allows limited placement and/or scaling tweaking of the graphic. The "TextureCoordScale" parameters are as follows the first number moves the graphic left and right, the next number moves the graphic up and down and the last two numbers change the horizontal and vertical scaling note LARGER numbers make the graphic SMALLER. Note MAT files which load a two-digit number eg. those plane numbering MATs with "C" in their filename have two such sections within the file each of which points to one digit of the number (one TGA file) and placement/scaling parameters for each digit.
The second yellow are highlighted allows a colout "tint" to be applied to a graphic for example if you design a white coloured graphic and wish this to be displayed in another colour then this is how it works. The first three parameters of the ColourScale are values of Red, Green and Blue ranging from 0.0 to 1.0 where 0.0 = 0 and 1.0 = 255. So if, for example, these parameters are set to 0.501 0.501 0.501 then your graphic will be mid-tone grey (Red 128, Green 128, Blue 128). To convert from RGB values in your graphics program DIVIDE the Red value by 255 then do the same for the Green and Blue values eg. 128/255 = 0.501. I have taken this to three decimal places. I'm not sure what the final parameter does , I though it might be some form of intensity value but settings other than 1.0 cause the graphic not to be displayed !. Astroman has used this to produce one set of white coloured number TGAs and three sets of MATs each with different ColourScale values to display them in different colours. As I believe that this "tint" effects the whole graphic I haven't used it in my Luftwaffe coloured numbering MATs as I wish to have the border surrounding the number in a different colour from the number itself. I will experiment more with this parameter. Thanks to AstroMan for passing on this gem.
The third yellow area highlited is the path to the TGA graphics file located in my C:\Program Files\Ubi Soft\IL2 Sturmovik\PaintSchemes\Regiments folder named "3.tga" which is my White weathered substitute number 3 graphic.Note this is one of a pair of MAT files which load the same number on both sides of the aircraft and only differ in having L and R at the appropriate point in their filenames.
Using MAT & TGA Files with the IL2MAT program.
My MAT files assume that the supplied TGA files have been unziped to C:\Program Files\Ubi Soft\IL-2 Sturmovik Forgotten Battles\PaintSchemes\Regiments folder and the MATs themselves have been unziped to C:\Program Files\Ubi Soft\IL-2 Sturmovik Forgotten Battles\CoopRegt (a new folder created during unzipping).
Please remember that to display my TGA files it is important to configure the IL2MAT program "Custom Markings Location" path to C:\Program Files\Ubi Soft\IL-2 Sturmovik Forgotten Battles\CoopRegt\ and set the "File types to be copied" setting to MAT also make sure that IL2MAT has a tick next to "Active" in the programs system tray icon.

When configuring IL2MAT please also remember the "Squadrons" tab in the configuration menu will allow you to substitute regimental artwork (TGA) for any Gruppe/Regiment supplied with the game. This will enable your chosen artwork to appear in online and offline dogfight, coop, campaign and quick mission builder missions. So if, for example, you wish your own squadron artwork to appear whenever I/JG3 is selected then simply assign the "substitution" here. I have mine configured to substitute my squadron's JG123 emblem on all Luftwaffe fighter gruppen and also to display when "none" is selected. IL2MAT also contains a usefull BMP file to TGA file convertor which will convert 24 bit colour BMP files into the TGA containing alpha channel format required.

Well I hope this was helpful in explaining the way MAT files work, if I have made any errors or missed anything please let me know. Armed with the above information you can edit/make your own MAT files. One last thing, there are a few more MAT files such as those with "Balken" or "Haken" in their name which load Balkencrosses such as my weathered versions or Hakencrosses (not supplied in my download packs but readily available on other IL2-related sites) and also "Null.MAT" which loads a blank graphic eg. where no Gruppe symbol exists as in the 1st Gruppe. I haven't done much with VVS aircraft MAT files but the above information should provide those of you that wish to try with some pointers however my all-files download includes substitute "redstar" MAT files and weathered TGA graphics files to go with them as well as a set of weathered numbers which display on the Lagg-5 and P39 aircraft.
I have invested many hours in working this out through experimentation because I wanted to have the game display these files in place of those supplied and have the choice to display new effects such as weathering and alternate Staffel colours and I hope that you will agree that they add something to the enjoyment off this great game.
I recommend this VERY usefull freeware program Replace.exe or a similar program for finding and replacing text in filenames and within files which is very handy when mass renaming MAT files etc.or mass replacing TextureName pathing information to TGA files or TextureCoordScale parameters within MAT files and can save hours of extremely tedious manual labour.. Some examples of just how usefull this program can be:
Example 1 : Find and replace the letter L in a selection of numbering MAT filenames with the letter R, halves one aspect of the workload in naming MAT files to display plane numbers.
Example 2 : Find and replace the letters FM03 in a selection of numbering MAT filenames with the letters FM04 to duplicate MAT files for another plane type eg. Bf109f2/f4/g2 numbering MAT files to work with Bf109G6.
Example 3 : Find and replace the letters NUM0 in a selection of numbering MAT filenames with the letters NUM1 to make them work with another Gruppe or NUM00 with NUM01 to make them work with another Staffel within this Gruppe.
Example 4 : Find and replace /Regiments/blue with /Regiments/red to replace the path to one set of coloured number TGA files with another for a different Staffel colour. (remember to also change the Staffel number in the filename see example 3).
Example 5 : Find and replace TextureCoordScale 0.0 0.0 1.0 1.0 (default settings) to TextureCoordScale 0.0 -0.1 1.3 1.3 to change the positioning and scaling parameters of all TGA files displayed by this selection of MAT files.
These are just a few usefull time and labour saving examples, there are many more.
Below is a step-by-step tutorial to creating TGA graphics files for use with the above MAT files. It is based on Paintshop Pro but Photoshop users shouldn't have much difficulty substituting Photoshop commands for those used here.
Below are two a short movies that I made to show the process of making suitable TGA files in Paint Shop Pro and Photoshop. The examples show the creation of a graphic to be used with the user-defined USAAF (USA) markings option in IL2-MAT Manager.
Note for Paint Shop Pro 8 users, use the "save as" rather than the "save" feature as there appears to be a bug that otherwise prevents the correct saving of the alpha-channel this doesn't happen in earlier versions.
Note for Photoshop 7.0 users, Adobe changed the function of the alpha-channel in the Targa plugin in this version. I recommend downloading and installing the version 7.0.1 patch available from Adobe on : http://www.adobe.com/support/downloads/detail.jsp?ftpID=1851 the tutorial is based on version 7.0.1 but should be the same for versions prior to version 7.0
If you view the videos you might wonder why I use the shift key+"magic wand" tool to select all the areas in image which will be transparent ie. not in the alpha-channel and then invert the selection when using Paint Shop Pro. In the case of the example graphic which only contains one colour one could omit these steps and select the actual graphic itself before saving this selection to the alpha-channel. However typically the graphics might well comprise of multi-coloured and/or more complex shapes such as numbers with outlines or multi-coloured roundels plus weathering effects etc. In such cases I have found it less time consuming to use the select and invert selection technique.
Click the Play button to view the video of your choice.
Paint Shop Pro tutorial Photoshop tutorial
Download movie (right click and save target as) Download movie (right click and save target as)
Hope this has whetted your appetite to have a go for yourselves, it's great fun seeing your own emblems and national markings graphics displayed in the game.
Stage 1.
Click on the "File" menu then on "New" to bring up the box below, change the size to Width 128 and Height 128.

This will open a new window into which you can draw your graphic, I have used a suitable font to draw the number 6 in white with a near-black colour outline as shown below. This great font for Luftwaffe numbers is available HERE.
Stage 2.

Stage 3.
When you have finished drawing the graphic make sure that the graphic is selected and click on the "Selections" menu to bring up the drop down box shown below, select the "Save to Alpha Channel" option

Stage 4.
This will display the box below, click on OK

Stage 5.
When the next box shown below appears click on OK again.

Stage 6.
Click on the "File" menu and then on "Save As" shown below

Stage 7.
Give the file a name, I have named mine "White6" and make sure that the file type is set to "Truevision Targa"

Stage 8.
Before saving the file click on the "Options" setting to bring up the box below and make sure that the Bit depth and Compression settings are set as per the example below.

Lastly click on "OK" to save the file. The most important thing to note is the "Uncompressed" option which is essential to display the Alpha information. In my example the area surrounding the graphic is black but it can be any colour as long as the bottom left pixel contains the desired transparency colour as this is what is used to determin what areas should be transparent.
Resizing and Positioning Regiment/Unit Emblems.
Following an enquiry regarding how to make the regiment/unit graphics supplied with the game smaller I thought I'd post the following sugested method for achieving this with IL2-MAT.
Regiment/Unit graphics files as supplied with the game are stored in 256 colour BMP format in your Program Files/Ubi Soft/IL-2 Sturmovik Forgotten Battles/PaintSchemes/Regiments folder. The following is a method for scaling and/or postitioning these emblems :
You will need a suitable graphics program eg. Photoshop or Paintshop Pro. First you will need to produce a TGA format version of your chosen emblem graphic. These instructions are for Paintshop Pro:
1. Open the BMP file of your choice (it should be 64x64
pixels 256 colours).
2. Increase the colour depth to 16 million
colours.
3. Use the selections tool to select the area around the graphic
(this will be displayed as a transparent area).
4. Reverse the selection so
that the area is now just the area of the graphic.
5. Save the selection to
an alpha channel.
6. Save the graphic as a 24 bits uncompressed Truevision
Targa TGA file to your /PaintSchemes/Regiments folder.
Please see the "Creating TGA Files" section of this page for an illustrated guide to steps 3-6.
Use IL2-MAT to make a substitution of this graphic for one of those supplied by the game using its "squadrons" tab and load IL2FB.
While Forgotten Battles is still running switch back (ALT-TAB) to the desktop and open Windows Explorer and navigate to the Program Files/Ubi Soft/IL-2 Sturmovik Forgotten Battles/PaintSchemes/Cache folder. You will find a MAT file named after the unit for which you have made the substitution. If the unit that I chose to make the substitution for was called "123th squadron" then MAT file will be called "UserRegiment123thsquadron.MAT". Open this file in notepad and edit the following parameters:
TextureCoordScale 0.0 0.0 1.0 1.0 (default values)
The first parameter moves the graphic slightly to the
left or right (note negative numbers move it to the right)
The second
parameter moves it up and down
The Third and fourth parameters make it LARGER
or SMALLER horizontally and vertically.
TextureName /Regiments/yourtgafilename.TGA
The above line must point to your TGA file which you have just created and saved to your Regiments folder.
Save this edited MAT file to you Program Files/Ubi Soft/IL-2 Sturmovik Forgtotten Battles/CoopRegt folder without the "UserRegiment" bit of the filename eg. the file should now be called just "123thsquadron.MAT", making sure that notepad doesn't change it's file extension to TXT, if so rename it back to .MAT.
Another example : If your unit is III/JG27 then the MAT file in your Cache folder would be called "UserRegimentIII_JG27.MAT" and after you have edited it save it to your CoopRegt folder as "III_JG27.MAT".
Quit IL2 FB and remove the emblem substitution in IL2-MAT's "squadrons" section by right clicking on it and selecting "remove".
The above needs doing only once. The reason that I suggest doing it this way is because IL2-MAT will substitute "regiments" graphics and (unlike other MAT's eg. those to load substitute markings, numbers etc.) it generates its own MAT files to load them, but, as you can see, you need a slightly "customised" MAT file which will change the scale and/or position of the graphic which will allways be loaded directly from the CoopRegt folder when IL2-FB starts and you don't want it to be re-created with "default" parameters by IL2-MAT using the squadrons substitutions every time. You willl have to experiment with scaling/positioning and repeat the above procedure once for every "substituted" graphic that you wish to have.
Example.
Here's a quick example that I produced using the above method. I took the 123 squadron emblem as supplied with the game and used the above method to produce a TGA file and edited the MAT file to have the graphic display smaller and slightly re-positioned.

The top image is as originally displayed by the game. The bottom image is re-scaled to 50% of the original size, re-positioned slightly left and down realtive to the top left corner.
Here's the two lines in the MAT file that I edited with their new values :
TextureCoordScale 0.3 -0.2 1.5 1.5
TextureName
/Regiments/123squadron.tga
You'll note that the first parameter 0.3 has moved it left (by a value of 0.3) the second -0.2 has moved it down (by a value of 0.2) and the last two parameters have reduced it by 50% horizontally and vertically. It looks strange that you have to INCREASE these values to make it SMALLER ! but that's the way it works.
In case your thinking "This all looks very complicated how do I get it working straight away ?". Well if you don't wish to create you own MATs and/or TGAs there's no problem. Download and configure the IL2MAT program. Then decide what you require. If you want everything that I've created, weathered numbers, letters, Gruppe symbols, tactical markings, balkencrosses, red stars etc. then download and unzip my All Files download. If you just require the substitute Tactical Markings then download and unzip my Tactical Markings add-on pack. If you only require the substitute coloured numbers and gruppe symbols then download and unzip my Coloured Numbers and Gruppe Symbols add-on pack. If you require my substitute coloured letters and Schlacht Gruppe symbols then download and unzip my Coloured Letters and Schlacht Gruppe Symbol add-on pack. If you only require the substitute Red Stars and Balkencrosses then download and unzip my Red Stars and Blackcrosses add-on pack. I have called these add-on packs because they add features to my original all files download but they work just fine as stand-alone packs each providing a new feature.
Cheers and S!
Aces